<?php

namespace app\index\model;

use think\Model;

class Invite extends Model
{
	protected $table = 'bolewang_jobjoin';
	//新增数据
	public function addresume($param){
        $title = Invite::get(['jobid'=>$param['jobid'],'personid'=>$param['personid']]);
        if(isset($title)){
			$this->error = '您已经申请过该职位!';
        	return false;
        }
		$this->startTrans();
		try{
			$this->data($param)->allowField(true)->save();
			$this->commit();
			return true;
		}catch(\Exception $e){
			$this->rollback();
			$this->error = '添加失败';
			return false;
		}
	}
}